import 'package:cms/models/term.dart';
import 'package:components/pull_down_refresh/controller.dart';

class TermListState {
  List<WpTerm> list = [];
  bool isLoading;
  LaraPressRefreshController refreshController;

  TermListState({
    this.list = const <WpTerm>[],
    this.isLoading = true,
    required this.refreshController,
  });

  factory TermListState.initial() {
    return TermListState(
      list: [],
      isLoading: true,
      refreshController: LaraPressRefreshController(),
    );
  }

  TermListState copyWith({
    List<WpTerm>? list,
    bool? isLoading,
    LaraPressRefreshController? refreshController,
  }) {
    return TermListState(
      list: list ?? this.list,
      isLoading: isLoading ?? this.isLoading,
      refreshController: refreshController ?? this.refreshController,
    );
  }
}
